simplification tricks for continued fraction